package com.guinea.core;

import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;

import com.guinea.core.orm.PropertyFilter;

/**
 * Author: cac Date: 2006-3-15
 */
public class Constants {
	public static final SimpleDateFormat DEFAULT_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
	public static final PropertyFilter DEFAULT_PROPERTY_FILTER =  new PropertyFilter(Constants.FILTER_NAME, Constants.STATUS_VALID);
	/**
	 * 测试用例使用的定义Spring Context 文件集合的字符串.
	 */
	public static final String DEFAULT_CONTEXT = "classpath*:spring/*.xml";

	/**
	 * 测试用例使用的定义Spring在测试时特别设置的Context 文件集合的字符串.
	 */
	public static final String DEFAULT_TEST_CONTEXT = "classpath*:spring/test/*.xml";
	
	public static final String STATUS_PROPERTY = "status";

	public static final String FILTER_NAME = "EQS_status";

	public static final String STATUS_INVALID = "0";

	public static final String STATUS_VALID = "1";

	public static final Map statusEnum = new HashMap();

	public static final String STATUS_AUTH = "1";

	public static final String STATUS_UNAUTH = "0";

	public static final Map authEnum = new HashMap();


	public static final String RESOURCE_URL = "URL";

	public static final String RESOURCE_FUNCTION = "FUNCTION";

	public static final String RESOURCE_COMPONENT = "COMPONENT";

	public static final Map resTypeEnum = new HashMap();

	static {
		statusEnum.put(STATUS_INVALID, "无效");
		statusEnum.put(STATUS_VALID, "有效");

		authEnum.put(STATUS_AUTH, "已授权");
		authEnum.put(STATUS_UNAUTH, "未授权");

		resTypeEnum.put("URL", RESOURCE_URL);
		resTypeEnum.put("FUNCTION", RESOURCE_FUNCTION);
		resTypeEnum.put("COMPONENT", RESOURCE_COMPONENT);
	}

	private Constants() {
	}

	public static Map statusEnum() {
		return statusEnum;
	}

	public static Map resTypeEnum() {
		return resTypeEnum;
	}

	public static Map authEnum() {
		return authEnum;
	}
}
